package cn.leetcode;

import java.util.ArrayList;
import java.util.List;

public class Code94 {

    public List<Integer> inorderTraversal(TreeNode root) {
        List<Integer> list = new ArrayList<>();
        fun(list, root);
        return list;
    }

    private void fun(List<Integer> list, TreeNode root){
        if(root == null){
            return;
        }
        fun(list, root.left);
        list.add(root.val);
        fun(list, root.right);
    }
}
